package object._02getclass;

public class Demo03 {
    public static void main(String[] args) {
        Father father = new Father();
        Class c1 = father.getClass();

        Son son = new Son();
        Class c2 = son.getClass();

        System.out.println(c1 == c2);

        boolean result1 = judge(father,son);
        System.out.println("result1 = " + result1);

        boolean result2 = judge(father,new Father());
        System.out.println("result2 = " + result2);
    }

    private static boolean judge(Object obj1,Object obj2) {
        return obj1.getClass() == obj2.getClass();
    }
}
class Father {

}
class Son extends Father {

}
